package com.youko.backstage.service.commodity;

import com.youko.backstage.bean.commodity.CommodityBrand;
import com.youko.backstage.mapper.commodity.CommodityBrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: youko
 * @classname: CommodityBrandService
 * @Description: CommodityBrand service类
 * @date: 2022/7/5 10:47
 */

@Service
public class CommodityBrandService {
    @Autowired
    private CommodityBrandMapper commodityBrandMapper;

    /**
     * 插入品牌
     * @param brandName
     */
    public void insertCommodityBrand(String brandName){
        commodityBrandMapper.insertBrand(brandName);
    }

    /**
     * 查询品牌
     * @param id
     * @param brandName
     */
    public void updateCommodityBrand(int id,String brandName){
        commodityBrandMapper.updateBrand(id,brandName);
    }

    /**
     * 删除品牌
     * @param id
     */
    public void deleteCommodityBrand(int id){
        commodityBrandMapper.deleteBrand(id);
    }

    /**
     * 查询品牌
     * @param id
     * @return
     */
    public CommodityBrand selectBrand(int id){
        return commodityBrandMapper.selectBrand(id);
    }

    /**
     * 查询所有品牌
     * @return
     */
    public List<CommodityBrand> selectAllBrand(){
        return commodityBrandMapper.selectAllBrand();
    }



}
